{% load filters %}
<div class="form-group{% if not field.is_readonly and field.errors %} errors{% endif %}">
    {% if not field.is_readonly and field.errors %}{{ field.errors }}{% endif %}
    {% if field.is_checkbox %}
        {% if field.required %}
            {{ field|field_class:'form-control' }}{{ field|label_class:'required control-label col-lg-2' }}
        {% else %}
            {{ field|field_class:'form-control' }}{{ field|label_class:'control-label col-lg-2' }}
        {% endif %}
    {% else %}
        {% if field.required %}
            {{ field|label_class:'required control-label col-lg-2' }}
        {% else %}
            {{ field|label_class:'control-label col-lg-2' }}
        {% endif %}
        <div class="col-lg-5">
            {% if field.is_readonly %}
                <p>{{ field.contents|linebreaksbr }}</p>
            {% else %}
                {{ field|field_class:'form-control' }}
            {% endif %}
        </div>
    {% endif %}
    {% if field.help_text %}
        <p class="help">{{ field.help_text|safe }}</p>
    {% endif %}
</div>